package com.aptemo.webetek.server.handlers;

import com.aptemo.webetek.client.commands.Action;
import com.aptemo.webetek.client.commands.impl.DeleteEventAction;
import com.aptemo.webetek.client.commands.responses.ResponseStatus;
import com.aptemo.webetek.client.exceptions.BackendException;
import com.aptemo.webetek.client.exceptions.WebetekLoginException;
import com.aptemo.webetek.server.datastore.DataStoreAPI;

public class DeleteEventHandler
		extends ActionHandler<DeleteEventAction, ResponseStatus>
{

	public DeleteEventHandler(DataStoreAPI service)
	{
		super(service);
	}

	public Class<? extends Action<?>> getActionType()
	{
		return DeleteEventAction.class;
	}

	@Override
	public ResponseStatus invoke(DeleteEventAction action) throws BackendException, WebetekLoginException
	{
		return new ResponseStatus(dataService.deleteEvent(action.getId()));
	}

}
